home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
pdcurs21.zip
/
PRIVATE.ZIP
/
_RAWGETC.C
< prev
next >
Wrap
Text File
|
1992-11-21
|
3KB
|
72 lines
#define CURSES_LIBRARY 1
#include <curses.h>
#ifndef NDEBUG
char *rcsid__rawgetc = "$Header: c:/curses/private/RCS/_rawgetc.c%v 2.0 1992/11/15 03:24:31 MH Rel $";
#endif
/*man-start*********************************************************************
PDC_rawgetch() - Returns the next uninterpreted character (if available).
PDCurses Description:
Gets a character without any interpretation at all and returns
it. If keypad mode is active for the designated window,
function key translation will be performed. Otherwise,
function keys are ignored. If nodelay mode is active in the
window, then PDC_rawgetch() returns -1 if no character is
available.
WARNING: It is unknown whether the FUNCTION key translation
is performed at this level. --Frotz 911130 BUG
PDCurses Return Value:
This function returns OK on success and ERR on error.
PDCurses Errors:
No errors are defined for this function.
Portability:
PDCurses int PDC_rawgetch( void );
**man-end**********************************************************************/
int PDC_rawgetch(void)
{
extern int c_pindex; /* putter index */
extern int c_gindex; /* getter index */
extern int c_ungind; /* wungetch() push index */
extern chtype c_ungch[NUNGETCH]; /* array of ungotten chars */
extern WINDOW* _getch_win_;
/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */
/* is the same window - all references to w changed*/
/* to _getch_win_ - marked with @@ */
signed c;
signed oldc;
if (_getch_win_ == (WINDOW *)NULL) /* @@ */
return( -1 );
if (_getch_win_->_nodelay && !typeahead(stdin)) /* @@ */
return( -1 );
while (1) /* loop to get valid char */
{
c = PDC_get_bios_key();
oldc = c;
/*
* Return the key if it is not a special key.
*/
if ((c = PDC_validchar(c)) >= 0)
{ /* get & check next char */
return( c );
}
if (_getch_win_->_use_keypad)
return( oldc );
}
}